home *** CD-ROM | disk | FTP | other *** search
- program load_runner;
- uses crt ,msgraph;
- var speed ,wait ,level ,music ,comp :integer;
-
- exit ,die :boolean;
- code :array[1..5] of string;
- no :array[1..5] of integer; {level number}
- vc :_videoconfig;
- a :integer;
- map :array[0..19 ,2..22] of integer;
-
- manx ,many ,manact :integer; {man coordinate & data}
- manfall :boolean;
- enax ,enay ,enaact :integer; {enemy A coordinate & data}
- enafall ,enagold :boolean;
- enbx ,enby ,enbact :integer; {enemy B coordinate & data}
- enbfall ,enbgold :boolean;
- encx ,ency ,encact :integer; {enemy C coordinate & data}
- encfall ,encgold :boolean;
- doorx ,doory :integer; {the place that the enemy appear}
-
- goldrem ,live :integer;
- score :longint;
-
- procedure initialize;
- begin
- a:=_setvideomode(_maxresmode);
- _getvideoconfig(vc);
- _clearscreen(_gclearscreen);
-
- music:=0; {Sound on if 0 ,sound off if 1}
- comp:=1; {Computer is 386 or 486 if 0 ,586 or upper is 1}
- speed:=2; {guard speed}
- wait:=2; {delay time}
- level:=1; {level play in game}
- exit:=false; {exit the game if true}
- die:=true; {die will occur if true}
-
- manact:=1;
- enaact:=0;
- enbact:=0;
- encact:=0;
- manfall:=false;
- enafall:=false;enagold:=false;
- enbfall:=false;enbgold:=false;
- encfall:=false;encgold:=false;
-
- goldrem:=0;
- score:=0;
- live:=2;
-
- randomize;
- end;
-
- procedure beep(temp :integer);
- var time ,p :longint;
- begin
- if music=0 then begin
- case temp of {given sound}
- 1 : sound(600); {man moving}
- 2 : sound(700); {man climbing ladder}
- 3 : sound(800); {man climbing wire}
- 4 : sound(900); {man falling}
- 5 : sound(350); {man breaking}
- 6 : sound(1500); {man get a gold}
- 7 : sound(2000); {man die}
-
- 8 : sound(1000); {enemy fall}
- 9 : sound(300); {enemy die}
- end;
- if (temp=6) or (temp=7) or (temp=9)
- then time:=100000
- else time:=60000; {delay time}
- if comp=0 then time:=time div 10;
- for p:=1 to time do;
- nosound;
- end;
- end;
-
- procedure readcode;
- var codefile :text;
- p :integer; {count order of the level}
- begin
- assign(codefile ,'code.dat');
- reset(codefile);
- for p:=1 to 6 do begin
- readln(codefile ,code[p]);
- readln(codefile ,no[p]);
- end;
- close(codefile);
- end;
-
- {start game procedure}
- {wallpaper object :brick ,gold ,ladder ,wire}
- {brick}
- procedure brick(x ,y :integer);
- var ran :integer;
- begin
- ran:=round(random);
- x:=x*32;
- y:=y*20;
- _setcolor(6);
- _rectangle(_gfillinterior ,x ,y ,x+32 ,y+20);
- if ran=1 then begin
- _setcolor(7);
- _moveto(x ,y+13);
- _lineto(x+20 ,y+13);
- _moveto(x+20 ,y);
- _lineto(x+20 ,y+20);
- _moveto(x+20 ,y+7);
- _lineto(x+32 ,y+7);
- end
- else begin
- _setcolor(7);
- _moveto(x ,y+10);
- _lineto(x+32 ,y+10);
- _moveto(x+10 ,y+10);
- _lineto(x+10 ,y);
- _moveto(x+20 ,y+10);
- _lineto(x+20 ,y+20);
- end;
- _setcolor(7);
- _rectangle(_gborder ,x ,y ,x+32 ,y+20);
-
- end;
-
- {gold}
- procedure gold(x ,y :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(14);
- _moveto(x+1 ,y+19);
- _lineto(x+15 ,y+19);
- _lineto(x+7 ,y+5);
- _lineto(x+1 ,y+19);
- _floodfill(x+8 ,y+10 ,14);
- _moveto(x+15 ,y+19);
- _lineto(x+30 ,y+19);
- _lineto(x+22 ,y+5);
- _lineto(x+15 ,y+19);
- _floodfill(x+23 ,y+10 ,14);
- end;
-
- {wire}
- procedure wire(x ,y :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(11);
- _moveto(x ,y+2);
- _lineto(x+32 ,y+2);
- end;
-
- {ladder}
- procedure ladder(x ,y :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(10);
- _moveto(x+9 ,y);
- _lineto(x+9 ,y+20);
- _moveto(x+20 ,y);
- _lineto(x+20 ,y+20);
- _moveto(x+9 ,y+6);
- _lineto(x+20 ,y+6);
- _moveto(x+9 ,y+15);
- _lineto(x+20 ,y+15);
- end;
- {ending wallpaper object}
-
- {man :man ,climan ,wcliman ,wireman ,fallman ,break}
- {walking man}
- procedure man(x ,y ,action :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(15);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+15);
- _lineto(x+12 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+18 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+12);
- _lineto(x+8 ,y+14);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+12);
- _lineto(x+22 ,y+14);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+7 ,y+13 ,x+9 ,y+14);
- _ellipse(_gfillinterior ,x+21 ,y+13 ,x+23 ,y+14);
- end
- {left}
- else if action=0 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+13 ,y+12);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+16);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+11 ,x+14 ,y+13);
- _ellipse(_gfillinterior ,x+19 ,y+15 ,x+21 ,y+17);
- end
- {right}
- else if action=2 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+10 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+17 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+18 ,y+12);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+16);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+17 ,y+11 ,x+19 ,y+13);
- _ellipse(_gfillinterior ,x+9 ,y+15 ,x+11 ,y+17);
- end;
- _setcolor(14);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {walking man under ladder}
- procedure wcliman(x ,y ,action :integer);
- begin
- ladder(x ,y);
- x:=x*32;
- y:=y*20;
- {walk climb man}
- _setcolor(15);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+15);
- _lineto(x+12 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+18 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+12);
- _lineto(x+8 ,y+14);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+12);
- _lineto(x+22 ,y+14);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+7 ,y+13 ,x+9 ,y+14);
- _ellipse(_gfillinterior ,x+21 ,y+13 ,x+23 ,y+14);
- end
- {left}
- else if action=0 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+13 ,y+12);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+16);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+11 ,x+14 ,y+13);
- _ellipse(_gfillinterior ,x+19 ,y+15 ,x+21 ,y+17);
- end
- {right}
- else if action=2 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+10 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+17 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+18 ,y+12);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+16);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+17 ,y+11 ,x+19 ,y+13);
- _ellipse(_gfillinterior ,x+9 ,y+15 ,x+11 ,y+17);
- end;
- _setcolor(14);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {Climbing ladder man}
- procedure climan(x ,y ,action :integer);
- begin
- ladder(x ,y);
- x:=x*32;
- y:=y*20;
- {climbing man}
- _setcolor(15);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+11 ,y+11);
- _lineto(x+11 ,y+15);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+17);
- _lineto(x+18 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+8);
- _lineto(x+10 ,y+3);
- _moveto(x+15 ,y+12);
- _lineto(x+20 ,y+12);
- _lineto(x+20 ,y+7);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+9 ,y+2 ,x+11 ,y+4);
- _ellipse(_gfillinterior ,x+19 ,y+6 ,x+21 ,y+8);
- end
- {climbing}
- else begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+11);
- _lineto(x+18 ,y+15);
- _moveto(x+15 ,y+15);
- _lineto(x+11 ,y+17);
- _lineto(x+11 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+8);
- _lineto(x+20 ,y+3);
- _moveto(x+15 ,y+12);
- _lineto(x+10 ,y+12);
- _lineto(x+10 ,y+7);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+9 ,y+6 ,x+11 ,y+8);
- _ellipse(_gfillinterior ,x+19 ,y+2 ,x+21 ,y+4);
- end;
- _setcolor(14);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {Climbing wire man}
- procedure wireman(x ,y ,action :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(15);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+13 ,y+15);
- _lineto(x+13 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+18 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+10);
- _lineto(x+7 ,y+2);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+10);
- _lineto(x+23 ,y+2);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+6 ,y+1 ,x+8 ,y+3);
- _ellipse(_gfillinterior ,x+22 ,y+1 ,x+24 ,y+3);
- end
- {climbing wire}
- else begin
- _setcolor(15);
- _moveto(x+15 ,y+15);
- _lineto(x+13 ,y+15);
- _lineto(x+12 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+19 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+10);
- _lineto(x+12 ,y+2);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+10);
- _lineto(x+18 ,y+2);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+11 ,y+1 ,x+13 ,y+3);
- _ellipse(_gfillinterior ,x+17 ,y+1 ,x+19 ,y+3);
- end;
- _setcolor(14);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {falling down man}
- procedure fallman(x ,y :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(15);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- _lineto(x+13 ,y+17);
- _lineto(x+10 ,y+14);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+17);
- _lineto(x+20 ,y+14);
- _moveto(x+15 ,y+10);
- _lineto(x+9 ,y+4 );
- _moveto(x+15 ,y+10);
- _lineto(x+21 ,y+4);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+8 ,y+3 ,x+10 ,y+5);
- _ellipse(_gfillinterior ,x+20 ,y+3 ,x+22 ,y+5);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {breaking brick man}
-
- procedure break(x ,y ,action :integer);
- begin
- x:=x*32;
- y:=y*20;
- {left}
- if action=1 then begin {break left brick on brick}
- _setcolor(15);
- _moveto(x+10 ,y+10);
- _lineto(x+15 ,y+15);
-
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
-
- _moveto(x+12 ,y+12);
- _lineto(x+3 ,y+17);
- _moveto(x+12 ,y+12);
- _lineto(x+15 ,y+10);
- _lineto(x+20 ,y+15);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+19 ,y+14 ,x+21 ,y+16);
- _ellipse(_gfillinterior ,x+1 ,y+15 ,x+5 ,y+19);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+6 ,y+6 ,x+10 ,y+10);
- end
- else if action=2 then begin {break right brick on brick}
- _setcolor(15);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+15);
-
- _lineto(x+13 ,y+17);
- _lineto(x+10 ,y+19);
- _moveto(x+10 ,y+15);
- _lineto(x+5 ,y+19);
-
- _moveto(x+13 ,y+12);
- _lineto(x+23 ,y+17);
- _moveto(x+13 ,y+12);
- _lineto(x+10 ,y+10);
- _lineto(x+5 ,y+15);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+4 ,y+14 ,x+6 ,y+16);
- _ellipse(_gfillinterior ,x+21 ,y+15 ,x+25 ,y+19);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+19 ,y+6 ,x+15 ,y+10);
- end
- else if action=3 then begin {break left brick on ladder}
- ladder(x div 32 ,y div 20);
- _setcolor(15);
- _moveto(x+10 ,y+10);
- _lineto(x+15 ,y+15);
-
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
-
- _moveto(x+12 ,y+12);
- _lineto(x+3 ,y+17);
- _moveto(x+12 ,y+12);
- _lineto(x+15 ,y+10);
- _lineto(x+20 ,y+5);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+19 ,y+4 ,x+21 ,y+6);
- _ellipse(_gfillinterior ,x+1 ,y+15 ,x+5 ,y+19);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+6 ,y+6 ,x+10 ,y+10);
- end
- else if action=4 then begin {break right brick on ladder}
- ladder(x div 32 ,y div 20);
- _setcolor(15);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+15);
-
- _lineto(x+13 ,y+17);
- _lineto(x+10 ,y+19);
- _moveto(x+10 ,y+15);
- _lineto(x+5 ,y+19);
-
- _moveto(x+13 ,y+12);
- _lineto(x+23 ,y+17);
- _moveto(x+13 ,y+12);
- _lineto(x+10 ,y+10);
- _lineto(x+9 ,y+5);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+8 ,y+4 ,x+10 ,y+6);
- _ellipse(_gfillinterior ,x+21 ,y+15 ,x+25 ,y+19);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+19 ,y+6 ,x+15 ,y+10);
- end
- else if action=5 then begin {break left brick on the wire}
- wire(x div 32 ,y div 20);
- _setcolor(15);
- _moveto(x+10 ,y+10);
- _lineto(x+15 ,y+15);
-
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
-
- _moveto(x+12 ,y+12);
- _lineto(x+3 ,y+17);
- _moveto(x+12 ,y+12);
- _lineto(x+15 ,y+10);
- _lineto(x+20 ,y+2);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+19 ,y+1 ,x+21 ,y+3);
- _ellipse(_gfillinterior ,x+1 ,y+15 ,x+5 ,y+19);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+6 ,y+6 ,x+10 ,y+10);
- end
- else if action=6 then begin {break right brick on the wire}
- wire(x div 32 ,y div 20);
- _setcolor(15);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+15);
-
- _lineto(x+13 ,y+17);
- _lineto(x+10 ,y+19);
- _moveto(x+10 ,y+15);
- _lineto(x+5 ,y+19);
-
- _moveto(x+13 ,y+12);
- _lineto(x+23 ,y+17);
- _moveto(x+13 ,y+12);
- _lineto(x+10 ,y+10);
- _lineto(x+5 ,y+2);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+4 ,y+1 ,x+6 ,y+3);
- _ellipse(_gfillinterior ,x+21 ,y+15 ,x+25 ,y+19);
- _setcolor(14);
- _ellipse(_gfillinterior ,x+19 ,y+6 ,x+15 ,y+10);
- end
- end;
- {ending of man}
-
- {enemy :enemy ,wclienemy ,clienemy ,wireenemy ,fallenemy ,brickenemy}
- {walking enemy}
- procedure enemy(x ,y ,action :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(14);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+15);
- _lineto(x+12 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+18 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+8);
- _lineto(x+8 ,y+6);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+8);
- _lineto(x+22 ,y+6);
- _setcolor(10);
- end
- {left}
- else if action=0 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+13 ,y+8);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+4);
- _setcolor(10);
- end
- {right}
- else if action=2 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+10 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+17 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+18 ,y+8);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+4);
- _setcolor(10);
- end;
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
- {walking man under ladder}
- procedure wclienemy(x ,y ,action :integer);
- begin
- ladder(x ,y);
- x:=x*32;
- y:=y*20;
- {walk climb man}
- _setcolor(14);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+15);
- _lineto(x+12 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+18 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+8);
- _lineto(x+8 ,y+6);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+8);
- _lineto(x+22 ,y+6);
- _setcolor(10);
- end
- {left}
- else if action=0 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+12 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+13 ,y+8);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+4);
- _setcolor(10);
- end
- {right}
- else if action=2 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+10 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+17 ,y+17);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+18 ,y+8);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+4);
- _setcolor(10);
- end;
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
-
- {climbing ladder enemy}
- procedure clienemy(x ,y ,action :integer);
- begin
- ladder(x ,y);
- x:=x*32;
- y:=y*20;
- {climbing man}
- _setcolor(14);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+10 ,y+17);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+13);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+6);
- _lineto(x+10 ,y+2);
- _moveto(x+15 ,y+12);
- _lineto(x+20 ,y+8);
- _lineto(x+20 ,y+4);
- _setcolor(10);
- end
- {climbing}
- else begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+20 ,y+17);
- _moveto(x+15 ,y+15);
- _lineto(x+10 ,y+13);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+6);
- _lineto(x+20 ,y+2);
- _moveto(x+15 ,y+12);
- _lineto(x+10 ,y+8);
- _lineto(x+10 ,y+5);
- _setcolor(10);
- end;
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
-
- {climbing wire enemy}
- procedure wireenemy(x ,y ,action :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(14);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- {orginal}
- if action=1 then begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+13 ,y+15);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+17 ,y+15);
- _lineto(x+15 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+10);
- _lineto(x+15 ,y+2);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+10);
- _lineto(x+15 ,y+2);
- end
- {climbing wire}
- else begin
- _setcolor(11);
- _moveto(x+15 ,y+15);
- _lineto(x+13 ,y+15);
- _lineto(x+8 ,y+19);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+23 ,y+19);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+10);
- _lineto(x+7 ,y+2);
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+10);
- _lineto(x+23 ,y+2);
- end;
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {falling down enemy}
- procedure fallenemy(x ,y :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(14);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- _setcolor(11);
- _lineto(x+12 ,y+15);
- _lineto(x+10 ,y+11);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+20 ,y+11);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+7);
- _lineto(x+9 ,y+3 );
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+7);
- _lineto(x+21 ,y+3);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
-
- {falling in break brick enemy}
- procedure brickenemy(x ,y :integer);
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(14);
- _moveto(x+15 ,y+5 );
- _lineto(x+15 ,y+15);
- _setcolor(11);
- _lineto(x+12 ,y+15);
- _lineto(x+1 ,y+17);
- _lineto(x+1 ,y+13);
- _moveto(x+15 ,y+15);
- _lineto(x+18 ,y+15);
- _lineto(x+31 ,y+17);
- _lineto(x+31 ,y+13);
- _moveto(x+15 ,y+10);
- _lineto(x+10 ,y+7);
- _lineto(x+1 ,y+3 );
- _moveto(x+15 ,y+10);
- _lineto(x+20 ,y+7);
- _lineto(x+32 ,y+3);
- _setcolor(12);
- _ellipse(_gfillinterior ,x+12 ,y+1 ,x+19 ,y+8);
- end;
- {ending of enemy}
-
- {mapping :readmap ,drawmap ,clear ,breakclear ,redraw ,refresh ,textprint ,showcode}
- {read map}
- procedure readmap;
- var mfile :text;
- symbol :integer;
- m ,n :integer;
- tempcode ,data :string;
- coordinate :string;
- begin
- case level of
- 1 : assign(mfile ,'map1.map');
- 2 : assign(mfile ,'map2.map');
- 3 : assign(mfile ,'map3.map');
- 4 : assign(mfile ,'map4.map');
- 5 : assign(mfile ,'map5.map');
- end;
- reset(mfile);
- goldrem:=0;
- for n:=2 to 22 do begin
- for m:=1 to 20 do begin
- map[m-1 ,n]:=0;
- end;
- end;
- for n:=2 to 22 do begin
- data:='';
- readln(mfile ,data);
- for m:=1 to 20 do begin
- tempcode:='';
- tempcode:=copy(data ,m ,1);
- val(tempcode ,map[m-1 ,n] ,symbol);
- end;
- end;
- readln(mfile ,data);
- {man}
- coordinate:=copy(data ,1 ,2);
- val(coordinate ,manx ,symbol);
- coordinate:=copy(data ,4 ,2);
- val(coordinate ,many ,symbol);
- readln(mfile ,data);
- {enemy A}
- coordinate:=copy(data ,1 ,2);
- val(coordinate ,enax ,symbol);
- coordinate:=copy(data ,4 ,2);
- val(coordinate ,enay ,symbol);
- readln(mfile ,data);
- {enemy B}
- coordinate:=copy(data ,1 ,2);
- val(coordinate ,enbx ,symbol);
- coordinate:=copy(data ,4 ,2);
- val(coordinate ,enby ,symbol);
- readln(mfile ,data);
- {enemy C}
- coordinate:=copy(data ,1 ,2);
- val(coordinate ,encx ,symbol);
- coordinate:=copy(data ,4 ,2);
- val(coordinate ,ency ,symbol);
- readln(mfile ,data);
- {door}
- coordinate:=copy(data ,1 ,2);
- val(coordinate ,doorx ,symbol);
- coordinate:=copy(data ,4 ,2);
- val(coordinate ,doory ,symbol);
- close(mfile);
- end;
-
- {draw map}
- procedure drawmap;
- var m ,n :integer;
- temp :integer;
- begin
- _clearscreen(_gclearscreen);
- goldrem:=0;
- for n:=2 to 22 do begin
- for m:=0 to 19 do begin
- temp:=map[m ,n];
- case temp of
- 1 : brick(m ,n);
- 2 : ladder(m ,n);
- 3 : wire(m ,n);
- 4 : begin
- gold(m ,n);
- goldrem:=goldrem+1;
- end;
- end;
- end;
- end;
- man(manx ,many ,1);
- enemy(enax ,enay ,1);
- enemy(enbx ,enby ,1);
- enemy(encx ,ency ,1);
- end;
-
- procedure clear(x ,y :integer); {clear part of unit}
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(0);
- _rectangle(_gfillinterior ,x+1 ,y+1 ,x+31 ,y+19);
- end;
-
- procedure breakclear(x ,y :integer); {clear of break brick procedure}
- begin
- x:=x*32;
- y:=y*20;
- _setcolor(0);
- _rectangle(_gfillinterior ,x ,y ,x+32 ,y+20);
- end;
-
- procedure redraw(x ,y :integer); {redraw the background}
- var temp :integer;
- begin
- temp:=map[x ,y];
- case temp of
- 1 : brick(x ,y);
- 2 : ladder(x ,y);
- 3 : wire(x ,y);
- 4 : gold(x ,y);
- end;
- if temp<=-1 then brickenemy(x ,y);
- end;
-
- procedure refresh;
- var m ,n :integer;
- temp :integer;
- begin
- for n:=2 to 22 do begin
- for m:=0 to 19 do begin
- temp:=map[m ,n];
- if (temp>=5) and (temp<=8)
- then map[m ,n]:=temp+1
- else if (temp<=-1) and (temp>=-6)
- then map[m ,n]:=temp-1;
- if (temp>8) or (temp<-6) then begin
- clear(m ,n);
- map[m ,n]:=1;
- redraw(m ,n);
- end;
- end;
- end;
- end;
-
-
- procedure textprint;
- var p :integer;
- temp :string;
- begin
-
- _settextcolor(15);
- for p:=0 to 79 do begin
- _settextposition(0 ,p);
- _outtext(' ');
- end;
- _settextposition(0 ,5);
- str(level ,temp);
- _outtext('Level :');_outtext(temp);
- _settextposition(0 ,17);
- str(live ,temp);
- _outtext('Life remain :');_outtext(temp);
- _settextposition(0 ,36);
- str(score ,temp);
- _outtext('Score :');_outtext(temp);
- _settextposition(0 ,51);
- str(goldrem ,temp);
- _outtext('Gold remain :');_outtext(temp);
- end;
-
- procedure showcode;
- var temp :string;
- check :boolean;
- key :char;
- begin
- _clearscreen(_gclearscreen);
- _settextcolor(13);
- _settextposition(7 ,34);
- _outtext('Game Over');
- _settextcolor(12);
- _settextposition(9 ,24);
- str(level ,temp);
- _outtext('You had been played at level ');
- _outtext(temp);
-
- _settextposition(11 ,23);
- _outtext('This password the this level is :');
-
- _settextposition(16 ,17);
- _outtext('You can type the password to play that level');
- _settextcolor(11);
- _settextposition(18 ,23);
- _outtext('Press Enter to back to main menu');
-
- _settextcolor(10);
- _settextposition(13 ,39-(length(code[level]) div 2));
- _outtext(code[level]);
-
- repeat
- check:=false;
- if keypressed then begin
- key:=readkey;
- if ord(key)=13 then check:=true;
- end;
- until check;
- end;
-
- {ending mapping}
- {End of Start game procedure}
-
- {movement}
- {fall down}
- procedure fall(check :string);
- begin
- if check='m' then begin {man fall down}
- beep(4);
- clear(manx ,many);
- redraw(manx ,many);
- manact:=1;
- if (map[manx ,many+1]=1) or (map[manx ,many+1]=2)
- then begin
- if map[manx ,many]=4 then begin
- beep(6);
- map[manx ,many]:=0;
- goldrem:=goldrem-1;
- score:=score+5000;
- textprint;
- clear(manx ,many);
- end;
- manfall:=false;
- man(manx ,many ,1);
- manact:=0;
- end
- else if (map[manx ,many+1])<=-1 then begin
- clear(manx ,many);
- redraw(manx ,many);
- manfall:=false;
- man(manx ,many ,1);
- manact:=0;
- end
- else many:=many+1;
- if map[manx ,many]=4 then begin
- beep(6);
- map[manx ,many]:=0;
- goldrem:=goldrem-1;
- score:=score+5000;
- textprint;
- clear(manx ,many);
- beep(6);
- if map[manx ,many+1]=0 then begin
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- manfall:=false;
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- end;
- end
- else begin
- case map[manx ,many] of
- 0 : begin
- if (map[manx ,many+1]<>1)
- and (map[manx ,many+1]<>2)
- and (map[manx ,many+1]>-1)
- then fallman(manx ,many);
- end;
- 3 : begin
- manfall:=false;
- wireman(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- end;
- end; {case}
- end;
- end {ending m}
- else if check='a' then begin {enemy A fall down}
- beep(8);
- clear(enax ,enay);
- redraw(enax ,enay);
- enaact:=1;
- if map[enax ,enay]=3 then enafall:=false
- else if (map[enax ,enay+1]=1) or (map[enax ,enay+1]=2)
- or (map[enax ,enay+1]<0)
- then begin
- if (map[enax ,enay]=4) and not(enagold)
- then begin
- map[enax ,enay]:=0;
- clear(enax ,enay);
- enagold:=true;
- end;
- enafall:=false;
- enemy(enax ,enay ,enaact);
- if enaact<>1 then enaact:=1
- else enaact:=0;
- end
- else enay:=enay+1;
- if (map[enax ,enay]=4) and not(enagold)
- then begin
- map[enax ,enay]:=0;
- clear(enax ,enay);
- enagold:=true;
- if map[enax ,enay+1]=0 then begin
- enafall:=true;
- fallenemy(enax ,enay);
- end
- else begin
- enemy(enax ,enay ,enaact);
- if enaact<>1 then enaact:=1
- else enaact:=0;
- end;
- end
- else if map[enax ,enay+1]>=5 then begin
- clear(enax ,enay);
- if enagold then
- map[enax ,enay]:=4;
- redraw(enax ,enay);
- enagold:=false;
- enafall:=false;
- enay:=enay+1;
- score:=score+2000;
- textprint;
- brickenemy(enax ,enay);
- map[enax ,enay]:=-1;
- end
- else begin
- case map[enax ,enay] of
- 0 : begin
- if (map[enax ,enay+1]<>1)
- and (map[enax ,enay+1]<>2)
- then fallenemy(enax ,enay);
- end;
- 3 : begin
- enafall:=false;
- wireenemy(enax ,enay ,enaact);
- if enaact<>1 then enaact:=1
- else enaact:=0;
- end;
- end; {case}
- end;
- end; {ending a}
- if check='b' then begin {enemy B fall down}
- beep(8);
- clear(enbx ,enby);
- redraw(enbx ,enby);
- enbact:=1;
- if map[enbx ,enby]=3 then enbfall:=false
- else if (map[enbx ,enby+1]=1) or (map[enbx ,enby+1]=2)
- or (map[enbx ,enby+1]<0)
- then begin
- if (map[enbx ,enby]=4) and not(enbgold)
- then begin
- map[enbx ,enby]:=0;
- clear(enbx ,enby);
- enbgold:=true;
- end;
- enbfall:=false;
- enemy(enbx ,enby ,enbact);
- if enbact<>1 then enbact:=1
- else enbact:=0;
- end
- else enby:=enby+1;
- if (map[enbx ,enby]=4) and not(enbgold)
- then begin
- map[enbx ,enby]:=0;
- clear(enbx ,enby);
- enbgold:=true;
- if map[enbx ,enby+1]=0 then begin
- enbfall:=true;
- fallenemy(enbx ,enby);
- end
- else begin
- enemy(enbx ,enby ,enbact);
- if enbact<>1 then enbact:=1
- else enbact:=0;
- end;
- end
- else if map[enbx ,enby+1]>=5 then begin
- clear(enbx ,enby);
- if enbgold then
- map[enbx ,enby]:=4;
- redraw(enbx ,enby);
- enbgold:=false;
- enbfall:=false;
- enby:=enby+1;
- score:=score+2000;
- textprint;
- brickenemy(enbx ,enby);
- map[enbx ,enby]:=-1;
- end
- else begin
- case map[enbx ,enby] of
- 0 : begin
- if (map[enbx ,enby+1]<>1)
- and (map[enbx ,enby+1]<>2)
- then fallenemy(enbx ,enby);
- end;
- 3 : begin
- enbfall:=false;
- wireenemy(enbx ,enby ,enbact);
- if enbact<>1 then enbact:=1
- else enbact:=0;
- end;
- end; {case}
- end;
- end; {ending b}
- if check='c' then begin {enemy C fall down}
- beep(8);
- clear(encx ,ency);
- redraw(encx ,ency);
- encact:=1;
- if map[encx ,ency]=3 then encfall:=false
- else if (map[encx ,ency+1]=1) or (map[encx ,ency+1]=2)
- or (map[encx ,ency+1]<0)
- then begin
- if (map[encx ,ency]=4) and not(encgold)
- then begin
- map[encx ,ency]:=0;
- clear(encx ,ency);
- encgold:=true;
- end;
- encfall:=false;
- enemy(encx ,ency ,encact);
- if encact<>1 then encact:=1
- else encact:=0;
- end
- else ency:=ency+1;
- if (map[encx ,ency]=4) and not(encgold)
- then begin
- map[encx ,ency]:=0;
- clear(encx ,ency);
- encgold:=true;
- if map[encx ,ency+1]=0 then begin
- encfall:=true;
- fallenemy(encx ,ency);
- end
- else begin
- enemy(encx ,ency ,encact);
- if encact<>1 then encact:=1
- else encact:=0;
- end;
- end
- else if map[encx ,ency+1]>=5 then begin
- clear(encx ,ency);
- if encgold then
- map[encx ,ency]:=4;
- redraw(encx ,ency);
- encgold:=false;
- encfall:=false;
- ency:=ency+1;
- score:=score+2000;
- textprint;
- brickenemy(encx ,ency);
- map[encx ,ency]:=-1;
- end
- else begin
- case map[encx ,ency] of
- 0 : begin
- if (map[encx ,ency+1]<>1)
- and (map[encx ,ency+1]<>2)
- then fallenemy(encx ,ency);
- end;
- 3 : begin
- encfall:=false;
- wireenemy(encx ,ency ,encact);
- if encact<>1 then encact:=1
- else encact:=0;
- end;
- end; {case}
- end;
- end; {ending c}
- end;
-
- {man}
- procedure manmove;
- var key :char;
- temp :boolean;
- begin
- if keypressed then begin
- key:=readkey;
- temp:=false;
- case ord(key) of
- 44 : begin {break left brick}
- if map[manx-1 ,many]<>1 then begin
- if map[manx-1 ,many+1]=1 then begin
- if (map[manx-1 ,many]<>2) and
- (map[manx-1 ,many]<>4) then begin
- beep(5);
- clear(manx ,many);
- redraw(manx ,many);
- breakclear(manx-1 ,many+1);
- if (map[manx ,many]=0) or (map[manx ,many]>=5)
- then break(manx ,many ,1)
- else if map[manx ,many]=2 then break(manx ,many ,3)
- else if map[manx ,many]=3 then break(manx ,many ,5);
- map[manx-1 ,many+1]:=5;
- _setcolor(7);
- if map[manx ,many+1]=1 then {right of brick}
- _rectangle(_gborder ,manx*32 ,(many+1)*20 ,manx*32+32 ,(many+1)*20+20);
- if map[manx-2 ,many+1]=1 then {left of brick}
- _rectangle(_gborder ,(manx-2)*32 ,(many+1)*20 ,(manx-2)*32+32 ,(many+1)*20+20);
- if map[manx-1 ,many+2]=1 then {lower of brick}
- _rectangle(_gborder ,(manx-1)*32 ,(many+2)*20 ,(manx-1)*32+32 ,(many+2)*20+20);
- if map[manx-1 ,many]=1 then {upper of brick}
- _rectangle(_gborder ,(manx-1)*32 ,many*20 ,(manx-1)*32+32 ,many*20+20);
- end;
- end;
- end; {break left brick}
- end;
-
- 46 : begin {break right brick}
- if map[manx+1 ,many]<>1 then begin
- if map[manx+1 ,many+1]=1 then begin
- if (map[manx+1 ,many]<>2) and
- (map[manx+1 ,many]<>4) then begin
- beep(5);
- clear(manx ,many);
- redraw(manx ,many);
- breakclear(manx+1 ,many+1);
- if (map[manx ,many]=0) or (map[manx ,many]>=5)
- then break(manx ,many ,2)
- else if map[manx ,many]=2 then break(manx ,many ,4)
- else if map[manx ,many]=3 then break(manx ,many ,6);
- map[manx+1 ,many+1]:=5;
- _setcolor(7);
- if map[manx ,many+1]=1 then {right of brick}
- _rectangle(_gborder ,manx*32 ,(many+1)*20 ,manx*32+32 ,(many+1)*20+20);
- if map[manx+2 ,many+1]=1 then {left of brick}
- _rectangle(_gborder ,(manx+2)*32 ,(many+1)*20 ,(manx+2)*32+32 ,(many+1)*20+20);
- if map[manx+1 ,many+2]=1 then {lower of brick}
- _rectangle(_gborder ,(manx+1)*32 ,(many+2)*20 ,(manx+1)*32+32 ,(many+2)*20+20);
- if map[manx+1 ,many]=1 then {upper of brick}
- _rectangle(_gborder ,(manx-1)*32 ,many*20 ,(manx-1)*32+32 ,many*20+20);
- end;
- end;
- end; {break right brick}
- end;
-
- 72 : begin {up}
- if many<>2 then begin
- if (map[manx,many]=2) and
- ((map[manx ,many-1]=0) or (map[manx ,many-1]=4)) then
- temp:=true;
- if (map[manx ,many-1]=2) or temp then begin
- beep(2);
- clear(manx ,many);
- many:=many-1;
- if map[manx ,many]=4 then begin
- map[manx ,many]:=0;
- goldrem:=goldrem-1;
- score:=score+5000;
- textprint;
- clear(manx ,many);
- manact:=1;
- beep(6);
- end;
- if temp=true then begin
- manact:=1;
- man(manx ,many ,manact);
- end
- else climan(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- redraw(manx ,many+1);
- end;
- end; {if <>2}
- end; {up}
-
- 80 : begin {down}
- if (map[manx ,many+1]=2) or
- (map[manx ,many+1]=4) then begin
- beep(2);
- clear(manx ,many);
- redraw(manx ,many);
- many:=many+1;
- case map[manx ,many] of
- 2 : begin
- climan(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- redraw(manx ,many-1);
- end;
- 4 : begin
- map[manx ,many]:=0;
- goldrem:=goldrem-1;
- score:=score+5000;
- textprint;
- clear(manx ,many);
- if map[manx ,many+1]=0 then begin
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- manact:=1;
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- end;
- end;
- end; {case}
- end {if}
- else if map[manx ,many+1]=0 then begin
- beep(4);
- clear(manx ,many);
- many:=many+1;
- if map[manx ,many+1]=0 then begin
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- end; {if}
- redraw(manx ,many-1);
- end {if}
- else if map[manx ,many+1]=3 then begin
- beep(3);
- clear(manx ,many);
- many:=many+1;
- manfall:=false;
- wireman(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- redraw(manx ,many-1);
- end; {if}
- end; {down}
-
- 75 : begin {left}
- if manx<>0 then begin
- if map[manx-1 ,many]<>1 then begin
- clear(manx ,many);
- manx:=manx-1;
- if manact=2 then manact:=0;
-
- case map[manx ,many] of
- 2 : begin
- beep(1);
- if map[manx ,many+1]<>2 then
- wcliman(manx ,many ,manact)
- else climan(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- redraw(manx+1 ,many);
- end;
- 3 : begin
- beep(3);
- wireman(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- redraw(manx+1 ,many);
- end;
- 4 : begin
- map[manx ,many]:=0;
- goldrem:=goldrem-1;
- score:=score+5000;
- textprint;
- clear(manx ,many);
- beep(6);
- if map[manx ,many+1]=0 then begin
- beep(4);
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- end;
- redraw(manx+1 ,many);
- end;
- 0 : begin
- if (map[manx ,many+1]=0) or
- (map[manx ,many+1]>=3) then begin
- beep(4);
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- beep(1);
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=0;
- end;
- redraw(manx+1 ,many);
- end;
- end; {case}
- if map[manx ,many]>=5 then begin
- redraw(manx+1 ,many);
- if (map[manx ,many+1]<>1) and (map[manx ,many]<>2)
- then begin
- beep(4);
- manfall:=true;
- fallman(manx ,many);
- end
- else man(manx ,many ,0);
- end; {if}
- end; {if}
- end; {if <>0}
- end; {left}
-
- 77 : begin {right}
- if manx<>19 then begin
- if map[manx+1 ,many]<>1 then begin
- clear(manx ,many);
- redraw(manx ,many);
- manx:=manx+1;
- if manact=0 then manact:=2;
-
- case map[manx ,many] of
- 2 : begin
- beep(1);
- if map[manx ,many+1]<>2 then
- wcliman(manx ,many ,manact)
- else climan(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=2;
- end;
- 3 : begin
- beep(3);
- wireman(manx ,many ,manact);
- redraw(manx-1 ,many);
- if manact<>1 then manact:=1
- else manact:=2;
- end;
- 4 : begin
- map[manx ,many]:=0;
- goldrem:=goldrem-1;
- score:=score+5000;
- textprint;
- clear(manx ,many);
- beep(6);
- if map[manx ,many+1]=0 then begin
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- beep(1);
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=2;
- end;
- redraw(manx-1 ,many);
- end;
- 0 : begin
- if (map[manx ,many+1]=0) or
- (map[manx ,many+1]>=3)then begin
- beep(4);
- manfall:=true;
- fallman(manx ,many);
- end
- else begin
- beep(1);
- man(manx ,many ,manact);
- if manact<>1 then manact:=1
- else manact:=2;
- end;
- redraw(manx-1 ,many);
- end;
- end; {case}
- if map[manx ,many]>=5 then begin
- redraw(manx-1 ,many);
- if (map[manx ,many+1]<>1) and (map[manx ,many]<>2)
- then begin
- beep(4);
- manfall:=true;
- fallman(manx ,many);
- end
- else man(manx ,many ,2);
- end; {if}
- end; {right}
- end; {case}
- end; {if}
- end; {if}
- end; {if <>22}
- end;
-
- {enemy movemeny :hormove ,enemymove}
- procedure hormove(var enex ,eney ,eneact :integer;
- var enefall ,enegold :boolean);
- var diffx :integer; {different of x between enemy and man}
- begin
- diffx:=manx-enex;
- if diffx<0 then begin {move left}
- if eneact=2 then eneact:=0;
- if map[enex-1 ,eney]<>1 then begin
- clear(enex ,eney);
- redraw(enex ,eney);
- enex:=enex-1;
- if (map[enex ,eney+1]=0) and (map[enex ,eney]<>2)
- and (map[enex ,eney]<>3) then begin
- enefall:=true;
- fallenemy(enex ,eney);
- end
- else if map[enex ,eney]=2 then begin
- if map[enex ,eney+1]=1
- then wclienemy(enex ,eney ,eneact)
- else clienemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=0;
- end
- else if map[enex ,eney]=3 then begin
- wireenemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=0;
- end
- else if map[enex ,eney]=4 then begin
- if not(enegold) then begin
- enegold:=true;
- clear(enex ,eney);
- map[enex ,eney]:=0;
- end;
- enemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=0;
- end;
- if (map[enex ,eney+1]>=5) and (map[enex ,eney]<>3)
- then begin
- clear(enex ,eney);
- if enegold then
- map[enex ,eney]:=4;
- redraw(enex ,eney);
- enegold:=false;
- enefall:=false;
- eney:=eney+1;
- score:=score+2000;
- textprint;
- brickenemy(enex ,eney);
- map[enex ,eney]:=map[enex ,eney]*(-1)+4;
- end
- else if (map[enex ,eney+1]=0) and (map[enex ,eney]<>3)
- and (map[enex ,eney]<>2)
- then begin
- enefall:=true;
- fallenemy(enex ,eney);
- end
- else if map[enex ,eney]<>3 then begin
- enemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=0;
- end;
- end; {if OK}
- end {if diffx<0}
- else if diffx>0 then begin {move right}
- if eneact=0 then eneact:=2;
- if map[enex+1 ,eney]<>1 then begin
- clear(enex ,eney);
- redraw(enex ,eney);
- enex:=enex+1;
- if ( (map[enex ,eney+1]=0) or (map[enex ,eney+1]>=5) )
- and (map[enex ,eney]<>2) and (map[enex ,eney]<>3)
- then begin
- enefall:=true;
- fallenemy(enex ,eney);
- end
- else if map[enex ,eney]=2 then begin
- if map[enex ,eney+1]=1
- then wclienemy(enex ,eney ,eneact)
- else clienemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=2;
- end
- else if map[enex ,eney]=3 then begin
- wireenemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=2;
- end
- else if map[enex ,eney]=4 then begin
- if not(enegold) then begin
- enegold:=true;
- clear(enex ,eney);
- map[enex ,eney]:=0;
- end;
- enemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=2;
- end;
- if (map[enex ,eney+1]>=5) and (map[enex ,eney]<>3)
- then begin
- clear(enex ,eney);
- if enegold then
- map[enex ,eney]:=4;
- redraw(enex ,eney);
- enegold:=false;
- enefall:=false;
- eney:=eney+1;
- score:=score+2000;
- textprint;
- brickenemy(enex ,eney);
- map[enex ,eney]:=map[enex ,eney]*(-1)+4;
- end
- else if (map[enex ,eney+1]=0) and (map[enex ,eney]<>3)
- and (map[enex ,eney]<>2)
- then begin
- enefall:=true;
- fallenemy(enex ,eney);
- end
- else if map[enex ,eney]<>3 then begin
- enemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=2;
- end;
- end; {if OK}
- end {if diffx>0}
- else if diffx=0 then begin
- clear(enex ,eney);
- redraw(enex ,eney);
- if map[enex ,eney]=3 then
- wireenemy(enex ,eney ,eneact)
- else if map[enex ,eney]=2 then begin
- if map[enex ,eney+1]=1 then
- wclienemy(enex ,eney ,eneact)
- else clienemy(enex ,eney ,eneact);
- end
- else if map[enex ,eney]=0
- then enemy(enex ,eney ,eneact);
- end;
- end; {end of procedure}
-
- procedure enemymove(var enex ,eney ,eneact :integer; {enemy movement}
- var enefall ,enegold :boolean);
- var diffy :integer; {different of y between enemy and man}
- diffx :integer; {different of x between enemy and man}
- begin
- diffy:=many-eney;
- diffx:=manx-enex;
- if map[enex ,eney]<-5 then begin
- map[enex ,eney]:=1;
- clear(enex ,eney);
- redraw(enex ,eney);
- enex:=doorx;
- eney:=doory;
- beep(9);
- end
- else if (map[enex ,eney]<=4) and (map[enex ,eney]>=0)
- then begin
- enefall:=false;
- if diffy<0 then begin {up}
- if (map[enex ,eney]=2) and (map[enex ,eney-1]<>1)
- then begin
- clear(enex ,eney);
- redraw(enex ,eney);
- eney:=eney-1;
- if map[enex ,eney]=2
- then begin
- clienemy(enex ,eney ,eneact);
- if eneact=1 then eneact:=0
- else eneact:=1;
- end
- else if map[enex ,eney]=0
- then begin
- enemy(enex ,eney ,1);
- eneact:=0;
- end
- else if map[enex ,eney]=4
- then begin
- if not(enegold) then begin
- enegold:=true;
- clear(enex ,eney);
- map[enex ,eney]:=0;
- end;
- enemy(enex ,eney ,1);
- eneact:=0;
- end;
- end {end if enemy can climb up}
- else hormove(enex ,eney ,eneact ,enefall ,enegold);
- end {if diffy<0}
- else if diffy>0 then begin {down}
- if ( (map[enex ,eney]=2) and (map[enex ,eney+1]<>1) )
- or (map[enex ,eney+1]=2)
- then begin
- clear(enex ,eney);
- redraw(enex ,eney);
- eney:=eney+1;
- if map[enex ,eney]=2
- then begin
- enefall:=false;
- if map[enex ,eney+1]=1
- then wclienemy(enex ,eney ,1)
- else clienemy(enex ,eney ,eneact);
- if eneact<>1 then eneact:=1
- else eneact:=0;
- end
- else if map[enex ,eney]=0
- then begin
- if (map[enex ,eney+1]=0)
- or (map[enex ,eney+1]=3)
- then begin
- enefall:=true;
- fallenemy(enex ,eney);
- end
- else begin
- enemy(enex ,eney ,1);
- eneact:=0;
- end
- end
- else if map[enex ,eney]=4
- then begin
- if not(enegold) then begin
- enegold:=true;
- clear(enex ,eney);
- map[enex ,eney]:=0;
- end;
- if map[enex ,eney+1]<>0
- then begin
- man(enex ,eney ,1);
- eneact:=0;
- end
- else begin
- enefall:=true;
- fallenemy(enex ,eney);
- end;
- end
- else if map[enex ,eney+1]>=5 then begin
- clear(enex ,eney);
- if enegold then
- map[enex ,eney]:=4;
- redraw(enex ,eney);
- enegold:=false;
- eney:=eney+1;
- score:=score+2000;
- textprint;
- brickenemy(enex ,eney);
- map[enex ,eney]:=map[enex ,eney]*(-1)+4;
- end;
- end {end if enemy can climb down}
- else if (diffx<=1) and (diffx>=-1)
- and (map[enex ,eney+1]=0) then begin
- clear(enex ,eney);
- redraw(enex ,eney);
- eney:=eney+1;
- enefall:=true;
- fallenemy(enex ,eney);
- end
- else hormove(enex ,eney ,eneact ,enefall ,enegold);
- end
- else if diffy=0 then hormove(enex ,eney ,eneact ,enefall ,enegold);
- end; {if can move to any direction}
- end; {end of procedure}
-
- procedure entergame;
- var key :char;
- n ,m :integer;
- act :integer;
- hit :boolean;
- begin
- _clearscreen(_gclearscreen);
- act:=1;
- hit:=false;
- for n:=2 to 21 do begin
- for m:=1 to 18 do begin
- man(m ,n ,act);
- act:=act+1;
- if act=3 then act:=0;
- end;
- end;
- _setcolor(12);
- _rectangle(_gfillinterior ,6*32 ,9*20 ,12*32-5 ,14*20);
- _setcolor(0);
- _rectangle(_gfillinterior ,6*32+5 ,9*20+5 ,12*35-45 ,14*20-5);
- _settextcolor(10);
- _settextposition(14 ,30);
- _outtext('Load Runner 98');
- _settextposition(16 ,30);
- _outtext('Press any key');
- repeat
- if keypressed then begin
- key:=readkey;
- hit:=true;
- if ord(key)=13 then key:='a';
- end;
- until hit;
- end;
-
-
- procedure endgame;
- var hit :boolean;
- p ,q :integer;
- key :char;
- begin
- hit:=false;
- a:=_setvideomode(_defaultmode);
- clrscr;
- gotoxy(30 ,5);
- textcolor(11);
- writeln('Congratulation');
- gotoxy(20 ,6);
- writeln('You had played all the level of this game');
- gotoxy(23 ,7);
- writeln('Thank you for you to play this game');
- gotoxy(20 ,9);
- textcolor(12);
- writeln('Staff List :');
- gotoxy(20 ,10);
- textcolor(10);
- writeln('Producer :Chan Man Fat');
- gotoxy(20 ,11);
- writeln('Director :Chan Man Fat');
- gotoxy(20 ,12);
- writeln('Programmer :Chan Man Fat');
- gotoxy(20 ,13);
- writeln('Graphics Editor :Chan Man Fat');
- gotoxy(20 ,14);
- writeln('Sound Editor :Chan Man Fat');
- gotoxy(30 ,16);
- textcolor(16);
- writeln('Load Runner version 98');
- repeat
- if keypressed then begin
- hit:=true;
- key:=readkey;
- if ord(key)=13 then key:='a';
- end;
- until hit;
- end;
-
- function press (live ,level :integer):boolean;
- var temp :string;
- hit :boolean;
- key :char;
- begin
- press:=false;
- hit:=false;
- _clearscreen(_gclearscreen);
- _settextcolor(11);
- _settextposition(9 ,30);
- str(live ,temp);
- _outtext('You have ');_outtext(temp);_outtext(' life remain');
- _settextposition(11 ,38);
- str(level ,temp);
- _outtext('Level ');_outtext(temp);
- _settextposition(13 ,29);
- _outtext('Press any key to play now');
- repeat
- if keypressed then begin
- press:=true;
- hit:=true;
- key:=readkey;
- if (ord(key)=44) or (ord(key)=46)
- or (ord(key)=72) or (ord(key)=80)
- or (ord(key)=75) or (ord(key)=77)
- then key:='a';
- end;
- until hit;
- end;
-
- {start game}
- procedure start;
- var temp :longint;
- p ,q ,n :integer;
- finish :boolean; {if finish the mission of the level then true}
- again :boolean; {play again the level if true}
- templive :integer;
- begin
- live:=2;
- if comp=1 then n:=500
- else n:=50;
- repeat {repeat ..until lost all life}
- manact:=1;
- enaact:=0;
- enbact:=0;
- encact:=0;
- manfall:=false;
- enafall:=false;enagold:=false;
- enbfall:=false;enbgold:=false;
- encfall:=false;encgold:=false;
- if press(live ,level) then begin
- temp:=4;
- readmap;
- drawmap;
- textprint;
- finish:=false;
- repeat {repeat ..until die or go to next level}
- again:=false;
- templive:=live;
- if temp mod 20=0 then refresh;
- if many<>22 then begin
- if manfall then fall('m')
- else for p:=1 to n
- do begin
- manmove;
- if ((manx=enax) and (many=enay)) or
- ((manx=enbx) and (many=enby)) or
- ((manx=encx) and (many=ency))
- then begin
- if die then begin
- again:=true;
- live:=live-1;
- end;
- end;
- end;
- end
- else begin
- again:=true;
- live:=live-1;
- end;
- if (speed=1) and (temp mod 7=0) or
- (speed=2) and (temp mod 5=0) or
- (speed=3) and (temp mod 3=0) then begin
- if enafall then fall('a')
- else if (map[enax ,enay]<5) and
- odd(temp) then
- enemymove(enax ,enay ,enaact ,enafall ,enagold);
- if enbfall then fall('b')
- else if (map[enbx ,enby]<5) and
- odd(temp) then
- enemymove(enbx ,enby ,enbact ,enbfall ,enbgold);
- if encfall then fall('c')
- else if (map[encx ,ency]<5) and
- odd(temp) then
- enemymove(encx ,ency ,encact ,encfall ,encgold);
- end;
- temp:=temp+1;
- if temp=1000000000 then temp:=4;
- {time delay}
- if wait=1 then begin
- for p:=1 to 21 do
- for q:=1 to 767+32000*(comp) do;
- end
- else if wait=2 then begin
- for p:=1 to 9 do
- for q:=1 to 767+32000*(comp) do;
- end
- else if wait=3 then begin
- for p:=1 to 2 do
- for q:=1 to 767+32000*(comp) do;
- end; {end of time delay}
- if ((manx=enax) and (many=enay)) or
- ((manx=enbx) and (many=enby)) or
- ((manx=encx) and (many=ency))
- then begin
- if die and not(again) then begin
- again:=true;
- live:=live-1;
- end;
- end;
- if templive-live>1 then live:=templive-1;
- until again or (goldrem=0);
- beep(7);
- finish:=false;
- if goldrem=0 then level:=level+1;
- if live<0 then finish:=true;
- if level=5 then finish:=true;
- end;
- until finish;
- if live<0 then showcode
- else if level=5 then endgame;
- level:=1;
- live:=2;
- score:=0;
- end;
-
- {menu procedure: introduce ,option}
- procedure introduce;
- var x ,y :integer;
- check :boolean;
- key :char;
- begin
- _clearscreen(_gclearscreen);
- {text}
- _settextcolor(12);
- _settextposition(3 ,10);_outtext('Programmer : Chan Man Fat ');
- _settextposition(4 ,10);_outtext('Site : http://www.geocities.com/Colosseum/Sideline/1858/index.html');
- _settextposition(5 ,10);_outtext('Welcome to visit my site');
- _settextcolor(11);
- _settextposition(8 ,1);
- _outtext(' This game is Load Runner .In this game ,you are a tomb raider .You should');
- _settextposition(9 ,1);
- _outtext('steal the gold in the tomb .Avoid to be caught by the guard ,you can break the');
- _settextposition(10 ,1);
- _outtext('brick ,and then they will fall to the hole .If they have gold ,the gold will');
- _settextposition(11 ,1);
- _outtext('fall to the land if they fall to hole .');
- _settextcolor(7);
- _settextposition(12 ,1);
- _outtext('Here are the control method of the game :');
- _settextposition(16 ,7) ;_settextcolor(14);_outtext('< ');
- _settextcolor(15);_outtext('-- Break the left-down brick');
- _settextposition(17 ,7) ;_settextcolor(14);_outtext('> ');
- _settextcolor(15);_outtext('-- Break the right-down brick');
- _settextposition(19 ,8);_settextcolor(10);_outtext('No need to press Shift when press < and >');
- _settextposition(23 ,1) ;_settextcolor(9);_outtext('Press Enter to next page');
- _settextposition(16 ,50);_settextcolor(15);_outtext('Direction key');
-
- {Cursor}
- _setcolor(14);
- {up}
- _moveto(450 ,230);_lineto(450 ,200);
- _lineto(440 ,210);_moveto(450 ,200);_lineto(460 ,210);
- {down}
- _moveto(450 ,270);_lineto(450 ,300);
- _lineto(440 ,290);_moveto(450 ,300);_lineto(460 ,290);
- {left}
- _moveto(380 ,250);_lineto(350 ,250);
- _lineto(360 ,240);_moveto(350 ,250);_lineto(360 ,260);
- {right}
- _moveto(510 ,250);_lineto(540 ,250);
- _lineto(530 ,240);_moveto(540 ,250);_lineto(530 ,260);
-
- repeat
- check:=false;
- if keypressed then begin
- key:=readkey;
- if ord(key)=13 then check:=true;
- end;
- until check;
- _clearscreen(_gclearscreen);
- {Drawing}
- man(4 ,3 ,1);
- enemy(4 ,6 ,1);
- brick(4 ,9);
- wire(4 ,12);
- ladder(4 ,15);
- gold(4 ,18);
- {Outtext}
- _settextposition(2 ,30);
- _settextcolor(13);
- _outtext('Symbol representation');
- _settextcolor(15);
- _settextposition(5 ,25);
- _outtext('-- He is the man that you control him');
- _settextposition(6 ,25);
- _outtext('You should take him to get all the gold');
- _settextposition(8 ,25);
- _settextcolor(14);
- _outtext('-- He is the enemy that if you are caught by him ,then');
- _settextposition(9 ,25);
- _outtext('you will die .In this game ,each level has 3 enemies');
- _settextposition(12 ,25);
- _settextcolor(12);
- _outtext('-- It is the brick that you can break it');
- _settextposition(13 ,25);
- _outtext(',to bury the enemies the this hole');
- _settextposition(15 ,25);
- _settextcolor(11);
- _outtext('-- It is the wire that you can climb on it');
- _settextposition(16 ,25);
- _outtext(',to walk to another place');
- _settextposition(19 ,25);
- _settextcolor(10);
- _outtext('-- It is the ladder that you can climb on it');
- _settextposition(20 ,25);
- _outtext(',to climb up or down to another place');
- _settextposition(22 ,25);
- _settextcolor(14);
- _outtext('-- It is the gold that you should get it');
- _settextposition(23 ,25);
- _outtext('.After you get all the gold ,you should go');
- _settextposition(24 ,25);
- _outtext('to the highest place by climbing ladder');
- repeat
- check:=false;
- if keypressed then begin
- key:=readkey;
- if ord(key)=13 then check:=true;
- end;
- until check;
- end;
- procedure option;
- var choice ,n ,m ,draw :integer;
- enter :boolean;
- key :char;
- default ,d ,p :integer;
- begin
- n:=20;
- draw:=1;
- a:=_setvideomode(_maxresmode);
- repeat
- _setcolor(10);
- _rectangle(_gfillinterior ,60 ,n ,90 ,n+20);
- _setcolor(0);
- _rectangle(_gfillinterior ,62 ,n+2 ,88 ,n+18);
- draw:=draw+1;
- n:=n+40;
- until draw>11;
- m:=20;
- choice:=1;
- enter:=true;
- {text}
- _settextcolor(14);
- {1}_settextposition(2 ,13);_outtext('-- Enemies'' speed slow');
- {2}_settextposition(5 ,13);_outtext('-- Enemies'' speed normal');
- {3}_settextposition(7 ,13);_outtext('-- Enemies'' speed fast');
- _settextcolor(13);
- {4}_settextposition(10 ,13);_outtext('-- Game''s speed slow');
- {5}_settextposition(12 ,13);_outtext('-- Game''s speed normal');
- {6}_settextposition(15 ,13);_outtext('-- Game''s speed fast');
- _settextcolor(11);
- {7}_settextposition(17 ,13);_outtext('-- Sound on');
- {8}_settextposition(20 ,13);_outtext('-- Sound off');
- _settextcolor(12);
- {9}_settextposition(22 ,13);_outtext('-- Slower computer (386SX to 486DX33)');
- {10}_settextposition(25 ,13);_outtext('-- Faster computer (486DX-66 or upper)');
- _settextcolor(15);
- {11}_settextposition(27 ,13);_outtext('-- Exit to main meun');
-
- _settextcolor(14);
- _settextposition(29 ,10);_outtext('Yellow in color is represent the default setting');
-
-
- repeat
- default:=1;
- _setcolor(12);
- _rectangle(_gfillinterior ,62 ,m+2 ,88 ,m+18);
-
- {highlight default setting}
- repeat
- d:=20;
- _setcolor(14);
- if (default<=3) and (default=speed) then begin
- d:=d+40*(default-1);
- _rectangle(_gfillinterior ,62 ,d+2 ,88 ,d+18)
- end
- else if (default<=6) and (default=wait+3) then begin
- d:=d+40*(default-1);
- _rectangle(_gfillinterior ,62 ,d+2 ,88 ,d+18)
- end
- else if (default<=8) and (default=music+7) then begin
- d:=d+40*(default-1);
- _rectangle(_gfillinterior ,62 ,d+2 ,88 ,d+18)
- end
- else if (default<=11) and (default=comp+9) then begin
- d:=d+40*(default-1);
- _rectangle(_gfillinterior ,62 ,d+2 ,88 ,d+18)
- end;
- default:=default+1;
-
- {hit key}
- if keypressed then begin
- key:=readkey;
- case ord(key) of
- 72 : begin
- _setcolor(0);
- _rectangle(_gfillinterior ,62 ,m+2 ,88 ,m+18);
- if choice>1 then begin
- m:=m-40;
- choice:=choice-1;
- end
- else begin
- m:=m+40*10;
- choice:=11;
- end;
- _setcolor(12);
- _rectangle(_gfillinterior ,62 ,m+2 ,88 ,m+18);
- end;
- 80 : begin
- _setcolor(0);
- _rectangle(_gfillinterior ,62 ,m+2 ,88 ,m+18);
- if choice<11 then begin
- m:=m+40;
- choice:=choice+1;
- end
- else begin
- m:=m-40*10;
- choice:=1;
- end;
- _setcolor(12);
- _rectangle(_gfillinterior ,62 ,m+2 ,88 ,m+18);
- end;
- 13 : begin
- for p:=1 to 11 do begin;
- _setcolor(0);
- _rectangle(_gfillinterior ,62 ,20+2+(p-1)*40 ,88 ,20+18+(p-1)*40);
- end;
- if choice<=3 then speed:=choice
- else if choice<=6 then wait:=choice-3
- else if choice<=8 then music:=choice-7
- else if choice<=10 then comp:=choice-9
- else enter:=false;
- end;
- end;
- end;
- until default>11;
- until not(enter);
- end;
-
- {game procedure: gamecode ,start}
- procedure gamecode(var die :boolean);
- var readtext :string;
- again ,checkcode :boolean;
- p :integer;
- key :char;
- check :boolean;
- begin
- repeat
- checkcode:=false; {If input is successfull ,it will true}
- clrscr;
- again:=true;
- gotoxy(25 ,2);textcolor(15);
- writeln('Load Runner Code Center');
- gotoxy(3 ,4);textcolor(14);
- writeln('Press Enter to back to main menu');
- gotoxy(3 ,5);textcolor(7);
- write('Please input the code of the level --');
- textcolor(12);
- readln(readtext);
- if readtext='' then again:=false
- else begin
- for p:=1 to 5 do begin
- if readtext=code[p] then begin
- again:=false;
- checkcode:=true;
- if (p>=1) and (p<=4) then begin
- level:=no[p];
- if level=0 then level:=1;
- p:=5;
- textcolor(11);
- writeln('You can go to play level ',level);
- writeln('Please press Enter to exit to main menu');
- writeln(',and select "Start new game" to play');
- check:=true;
- again:=false;
- textcolor(12);
- repeat
- if keypressed then begin
- key:=readkey;
- if ord(key)=13 then check:=false;
- end;
- until not(check);
- end
- else begin
- textcolor(11);
- writeln('You will not die....');
- die:=false;
- again:=true;
- check:=true;
- textcolor(12);
- repeat
- if keypressed then begin
- key:=readkey;
- if ord(key)=13 then check:=false;
- end;
- until not(check);
- end;
- end;
- end;
- end;
- if not(checkcode) and (readtext<>'')
- and (readtext<>'')then begin
- textcolor(10);
- writeln('Wrong code .');
- write('Please press Enter to input again');
- check:=true;
- textcolor(12);
- repeat
- if keypressed then begin
- key:=readkey;
- if ord(key)=13 then check:=false;
- end;
- until not(check);
- end;
- until not(again);
- end;
-
- procedure menu(var exit :boolean);
- var no ,symbol :integer;
- choice :integer;
- key :char;
- again ,enter :boolean;
- n ,m ,draw :integer;
- begin
- repeat
- _getvideoconfig(vc);
- a:=_setvideomode(_maxresmode);
- n:=103;
- draw:=1;
- again:=true;
- _clearscreen(_gclearscreen);
- repeat
- _setcolor(10);
- _rectangle(_gfillinterior ,150 ,n ,180 ,n+20);
- _setcolor(0);
- _rectangle(_gfillinterior ,152 ,n+2 ,178 ,n+18);
- n:=n+35;
- draw:=draw+1;
- until draw>5;
- {text}
- _settextcolor(14);
- _settextposition(5 ,25);_outtext('Welcome to Load Runner');
- _settextcolor(15);
- _settextposition(8 ,25);_outtext('Introduction of the game');
- _settextposition(10 ,25);_outtext('Select the level of the game');
- _settextposition(12 ,25);_outtext('Option of the game');
- _settextposition(14 ,25);_outtext('Start new game');
- _settextposition(16 ,25);_outtext('Exit the game');
-
- m:=103;
- choice:=1;
- enter:=true;
- repeat
- _setcolor(12);
- _rectangle(_gfillinterior ,152 ,m+2 ,178 ,m+18);
- if keypressed then begin
- key:=readkey;
- case ord(key) of
- 72 : begin
- _setcolor(0);
- _rectangle(_gfillinterior ,152 ,m+2 ,178 ,m+18);
- if choice>1 then begin
- m:=m-35;
- choice:=choice-1;
- end
- else begin
- m:=m+35*4;
- choice:=5;
- end;
- _setcolor(12);
- _rectangle(_gfillinterior ,152 ,m+2 ,178 ,m+18);
- end;
- 80 : begin
- _setcolor(0);
- _rectangle(_gfillinterior ,152 ,m+2 ,178 ,m+18);
- if choice<5 then begin
- m:=m+35;
- choice:=choice+1;
- end
- else begin
- m:=m-35*4;
- choice:=1;
- end;
- _setcolor(12);
- _rectangle(_gfillinterior ,152 ,m+2 ,178 ,m+18);
- end;
- 13 : begin
- enter:=false;
- if choice=1 then introduce
- else if choice=2 then begin
- a:=_setvideomode(_defaultmode);
- gamecode(die);
- end
- else if choice=3 then option
- else if choice=4 then begin
- start;
- end
- else again:=false;
- end;
- end;
- end;
- until not(enter);
- until not(again);
- end;
-
- {main}
- begin
- initialize;
- readcode;
- entergame;
- menu(exit);
- a:=_setvideomode(_defaultmode);
- end.
-